/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo img {
    height: 40px;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-right: 20px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.user-actions {
    display: flex;
    align-items: center;
}

.login-btn, .register-btn {
    float: right;
    margin-right: 15px;
    text-decoration: none;
    color: #333;
}

.cart-btn {
    float: right;
    position: relative;
    display: inline-block;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #f01414;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* 轮播图样式 */
.slider {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    cursor: pointer;
}

.dot.active {
    background-color: #fff;
}

/* 商品网格样式 */
.products {
    padding: 40px 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 16px;
    margin-bottom: 10px;
}

.product-price {
    color: #0f0f0f;
    font-weight: bold;
    font-size: 18px;
}

.add-to-cart {
    display: block;
    width: 100%;
    padding: 8px 0;
    background-color: #f01414;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

/* 认证页面样式 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
    padding: 40px 0;
}

.auth-form {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.error-message {
    color: #f01414;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #f01414;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links a {
    color: #666;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

/* 购物车样式 */
.cart-container {
    padding: 40px 0;
}

.cart-items {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    margin-right: 20px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #f01414;
    font-weight: bold;
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    background-color: #f5f5f5;
    border: none;
    cursor: pointer;
}

.quantity-control input {
    width: 50px;
    text-align: center;
    margin: 0 5px;
}

.remove-item {
    color: #666;
    cursor: pointer;
}

.empty-cart {
    text-align: center;
    padding: 40px 0;
}

.cart-summary {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-details p {
    margin-bottom: 10px;
}

.total-price {
    font-size: 20px;
    font-weight: bold;
}

.btn-checkout {
    padding: 12px 30px;
    background-color: #f01414;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
    }
    
    .main-nav {
        margin: 15px 0;
    }
    
    .slider {
        height: 250px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.cart-btn {
    position: relative;
    display: inline-block;
    padding: 8px;
}

.cart-icon {
    width: 24px;
    height: 24px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #f01414;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}